Skip to content

Conversation

@noahsmartin
Copy link
Contributor

This is a POC for how I think we should solve #4618

It fixes an existing race condition and moves the image handler to a background thread. Synchronization is now done safely with atomics so the crash handler can read from the added images without risk of race conditions (which existed before).

#skip-changelog

@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@codecov
Copy link

codecov bot commented Jan 23, 2026

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
85 3 82 1
View the top 3 failed test(s) by shortest run time
SentryCrashBinaryImageCacheTests::testRemoveImageAddAgain
Stack Traces | 0s run time
.../SentryTests/SentryCrash/SentryCrashBinaryImageCacheTests.m:309 - ((counter) equal to (expected)) failed: ("1") is not equal to ("5")
SentryCrashBinaryImageCacheTests::testRemoveImageFromBeginning
Stack Traces | 0s run time
.../SentryTests/SentryCrash/SentryCrashBinaryImageCacheTests.m:309 - ((counter) equal to (expected)) failed: ("1") is not equal to ("5")
SentryCrashBinaryImageCacheTests::testRemoveImageFromTail
Stack Traces | 0s run time
.../SentryTests/SentryCrash/SentryCrashBinaryImageCacheTests.m:309 - ((counter) equal to (expected)) failed: ("1") is not equal to ("5")
SentryTests.PrivateSentrySDKOnlyTests::testProfilingStartAndCollect
Stack Traces | 0s run time
.../Tests/SentryTests/PrivateSentrySDKOnlyTests.swift:271 - XCTAssertGreaterThan failed: ("0") is not greater than ("0")
SentryTests.SentryFileManagerTests::testCreateDirectoryIfNotExists_successful_shouldNotLogError
Stack Traces | 0s run time
.../SentryTests/Helper/SentryFileManagerTests.swift:1056 - XCTAssertEqual failed: ("1") is not equal to ("0")

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@noahsmartin noahsmartin added the ready-to-merge Use this label to trigger all PR workflows label Jan 23, 2026
add_dyld_image(mh);
}

void dyld_tracker_start(void) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should have sentry's prefix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Use this label to trigger all PR workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants